package com.imu.purse.modules.app.dao;

import com.imu.core.base.BaseMapper;
import com.imu.purse.modules.app.entity.ImuUserEntity;
import com.imu.purse.modules.app.entity.ImuUserLogEntity;
import com.imu.purse.modules.app.entity.TokenEntity;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 用户Token
 * 
 * @author sunhw
 * @email sunhongwei@gmail.com
 * @date 2017-03-23 15:22:07
 */
public interface ImuUserLogMapper extends BaseMapper<ImuUserLogEntity> {
    /**
     * 分页查询
     * @return
     */
    @Select({
            "<script>",
            "SELECT id,",
            "userid, ",
            "opername, ",
            "phone, ",
            "operaction, ",
            "remark ,",
            "opertime ",

            "FROM imu_user_log ",
            "WHERE 1 = 1 ",
            "<when test = 'p != null and !p.isEmpty()'>",
            "AND userid = #{p} ",
            "</when>",
            "ORDER BY opertime DESC",
            "</script>"
    })
    public List<ImuUserLogEntity> findByPage(final ImuUserLogEntity entity);
}
